StupidBeauty
Read times:344Posted at:Fri Feb 3 05:25:13 2012
- no title specified

Wt3.2.0文档翻译:Wt::WSubMenuItem类参考,Wt::WSubMenuItem Class Reference

详细描述

这個菜单条目包含一個嵌套的子菜单。

这個类专门用来表示可能拥有子菜单的菜单项。

当此条目被显示或隐藏时,分别被选中或取消选中。(When the item is shown and hidden when the item is selected respectively deselected.)

使用示例:

// 创建内容栈,内容将會放置在其中

Wt::WStackedWidget *contents = new Wt::WStackedWidget();

// 创建一個顶级菜单

Wt::WMenu *menu = new Wt::WMenu(contents, Wt::Vertical);

// 添加两個普通条目

menu->addItem("Introduction", new Wt::WText(tr("intro"));

menu->addItem("Download", new Wt::WText("Not yet available"));

// 添加一個具有子菜单的条目

Wt::WSubMenuItem *examples = new Wt::WSubMenuItem("Examples", new Wt::WText(tr("examples")));

Wt::WMenu *examplesMenu = new Wt::WMenu(contents, Wt::Vertical);

examplesMenu->addItem("Hello world", new Wt::WText(tr("example.hello-world")));

examplesMenu->addItem("Shopping cart", new Wt::WText(tr("example.shopping")));

examples->setSubMenu(examplesMenu);

menu->addItem(examples);

addWidget(menu);

addWidget(contents);

参考:

WMenuItemWMenu

Your opinions
Your name:Email:Website url:Opinion content:
- no title specified

HxLauncher: Launch Android applications by voice commands

 
Recent comments
2017年4月~2019年4月垃圾短信排行榜Posted at:Thu Sep 26 04:51:48 2024
Qt5.7文档翻译:QWebEngineCookieStore类,QWebEngineCookieStore ClassPosted at:Fri Aug 11 06:50:35 2023盲盒kill -9 18289 Grebe.20230517.211749.552.mp4